﻿using MovingChameLibrary.Models;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace MovingChameLibrary.Extensions
{
    public static class CollectionExtension
    {
        public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> source)
        {
            ObservableCollection<T> collection = new ObservableCollection<T>();
            foreach (T item in source)
                collection.Add(item);
            return collection;
        }

        public static CustomObservableCollection<T> ToCustomObservableCollection<T>(this IEnumerable<T> source)
        {
            CustomObservableCollection<T> collection = new CustomObservableCollection<T>();
            foreach (T item in source)
                collection.Add(item);
            return collection;
        }
    }
}